#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<int> minSubsequence(vector<int>& nums) {
        sort(nums.begin(), nums.end(), greater<int>());

        int secondAdd = 0;
        int firstAdd = 0;
        vector<int> v1;
        for (auto& e : nums)
        {
            secondAdd += e;
        }

        for (auto& e : nums)
        {
            if (firstAdd <= secondAdd)
            {
                v1.push_back(e);
                firstAdd += e;
                secondAdd -= e;
                continue;
            }
            break;
        }

        return v1;
    }
};